from django.contrib.auth.decorators import login_required
from django.urls import path
from django.views.generic import TemplateView

from apps.users.views import UserInfoView, UploadImageView, ChangePwdView, ChangeMobileView, MyCourseView, MyFavOrgView, \
    MyFavTeacherView, MyFavCourseView, MyMessageView

app_name = 'users'

urlpatterns = [
    path('info/', UserInfoView.as_view(), name='userinfo'),
    path('image/upload/', UploadImageView.as_view(), name='image'),
    path('image/upload/', UploadImageView.as_view(), name='image'),
    path('update/pwd/', ChangePwdView.as_view(), name='update_pwd'),
    path('update/mobile/', ChangeMobileView.as_view(), name='update_mobile'),
    path('mycourse/', MyCourseView.as_view(), name='my_course'),
    path('my_fav_org/', MyFavOrgView.as_view(), name='my_fav_org'),
    path('my_fav_teacher/', MyFavTeacherView.as_view(), name='my_fav_teacher'),
    path('my_fav_course/', MyFavCourseView.as_view(), name='my_fav_course'),
    path('messages/', MyMessageView.as_view(), name='messages'),
    # path(r'^mycourse/$', login_required(TemplateView.as_view(template_name="usercenter-mycourse.html"),
    # login_url="/login/"),{"current_page":"mycourse"}, name="mycourse"),
]
